package com.mk.jta.xa.demo.controller;

import com.mk.jta.xa.demo.service.JtaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("jta-test")
public class JtaController {
    @Autowired
    private JtaService jtaService;

    @PostMapping("save")
    public void save() {
//        jtaService.save();
//        jtaService.saveRollBack();
        jtaService.update();
    }


}
